home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Applications / Demos_Demo folder / Demos_Info folder / Demos™ Demonstration / More Examples / Beta example next >
Text File  |  1994-01-07  |  2KB  |  95 lines

  1. { From user Brian Sterling, Project Beta_example at Fri, Jan 7, 1994 2:55 PM}
  2.  
  3.  
  4. { System Variables with non-default values: }
  5. Samplesize := 200
  6. Typechecking := 1
  7. Checking := 1
  8. Saveoptions := 2
  9. Savevalues := 0
  10.  
  11.  
  12. { Non-default Time SysVar value: }
  13. Time := [0,1,2]
  14.  
  15. Project Beta_example
  16. Title: Beta distribution example
  17. Description: An example of the use of the beta distribution.~
  18. A coin is flipped repeatedly, and the probability of it landing heads up given the ~
  19. results is calculated along the way.
  20. Author: Brian Sterling
  21. Date: Fri, Dec 31, 1993 1:55 PM
  22. Saveauthor: Brian Sterling
  23. Savedate: Fri, Jan 7, 1994 2:55 PM
  24. Diagstate: 1,40,50,449,243,1
  25. Fileinfo: 0,-1,1779,Project Beta_example,beta example
  26. Getresource ,1
  27.  
  28. Objective Prob._of_h
  29. Title: Prob. of heads
  30. Description: Probability of heads, indexed by trial
  31. Definition: Beta( Total_head, Total_tail )
  32. Location: 328,136
  33. Nodesize: 48,20
  34. Valuestate: 1,38,53,443,279,1,PDFP
  35. Graphsetup: Distresol:4~
  36. Diststeps:1~
  37. Symbolsize:6~
  38. Linestyle:1~
  39. Frame:1~
  40. Grid:1~
  41. Ticks:1~
  42. Mesh:1~
  43. Scales:1~
  44. Frameauto:0~
  45. Xminimum:0~
  46. Xmaximum:1~
  47. Yminimum:0~
  48. Ymaximum:6~
  49. Zminimum:0~
  50. Zmaximum:30~
  51. Xintervals:0~
  52. Yintervals:6~
  53.  
  54. Reformval:           [Trial     ,Probability]
  55.  
  56. Index Trial
  57. Title: trial
  58. Description: An index for the trial number
  59. Definition: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
  60. Location: 88,40
  61. Nodesize: 48,20
  62.  
  63. Chance Heads
  64. Title: heads
  65. Description: Trials resulting in heads
  66. Definition: Table(Trial)(
  67. 1,0,1,1,0,0,1,1,0,1,1,1,1,0,1,0,0,0,1,0,0,1,0,1,0,0,0,1,0,1)
  68. Location: 88,104
  69. Nodesize: 48,20
  70.  
  71. Chance Tails
  72. Title: tails
  73. Description: Trials resulting in tails
  74. Definition: if not heads then 1 else 0
  75. Location: 88,160
  76. Nodesize: 48,20
  77. Valuestate: 1,104,114,416,303,0,MIDM
  78.  
  79. Chance Total_head
  80. Title: total heads
  81. Description: Cumulative number of heads
  82. Definition: Cumulate( heads, trial )
  83. Location: 208,104
  84. Nodesize: 48,20
  85. Valuestate: 1,136,146,416,303,1,MIDM
  86.  
  87. Chance Total_tail
  88. Title: total tails
  89. Description: Cumulative number of tails
  90. Definition: Cumulate( tails, trial )
  91. Location: 208,160
  92. Nodesize: 48,20
  93.  
  94. Close Beta_example
  95.